"""
# -*- coding: utf-8 -*-
# @Time : 2023/4/22 22:22
# @Author : LTY
# @File : Serial_test.py
# @function : python3.9.2
"""
import binascii
a = 50
a3 = str(a)

# print(hex(ord(str(a))))
# a2 = hex(ord(str(a)))
# a3 = hex(ord(a))
# print(a2)
# print(type(a2))
a5 = hex(a)        # 0x32,str
a6 = hex(a)[2:]     # 32, str
# a6 = chr(a)       # 2
# print(a5)
# print(a6)
# print(type(a6))
# a4 = a6.to_bytes(1, 'big')
# print(a4)
# a7 = a5.to_bytes(1, 'big')
# print(a7)
# a8 =
# Serial_code = b'\x7e\x01\x01\x0c'
# print(Serial_code + a4)
# print('\x00{}'.format(a6))    # 不行
# print(type(a3))
# print(a2.to_bytes)
# print(binascii.b2a_hex())
a7 = int(a6, base=16).to_bytes(1, 'big')
print(a7)
# a7 = binascii.b2a_hex(a6)